Some AGS Members aren't covered by C#'s base types and others are synonyms for existing methods, so we capture them here. NOTE: Extension properties don't exist in C#, so we have to implement some as extension methods e.g. string s.AsFloat becomes s.AsFloat()


Methods


Append

static string Append(this string str, string appendText)

Returns a new string with the specified string appended to this string.


AppendChar

static string AppendChar(this string str, char extraChar)  
static string AppendChar(this string str, int extraChar)

Returns a new string that has the extra character appended.


AsFloat

static float AsFloat(this string str)

Converts the string to a float.


AsInt

static LooseInteger AsInt(this string str)

Converts the string to an integer.


Chars

static char[] Chars(this string str)

Accesses individual characters of the string.


CompareTo

static int CompareTo(this string str, string otherString, bool caseSensitive)

Compares this string to the other string


Copy

static string Copy(this string str)

Creates a copy of the string (C# string passed by value, so already copied)


DayOfMonth

static int DayOfMonth(this DateTime dateTime)

Gets the DayOfMonth (1-31) component of the date. Has to be implemented as extension method, extension properties do not exist(!)


EndsWith

static bool EndsWith(this string str, string endsWithText, bool caseSensitive)

Checks whether this string ends with the specified text.


LowerCase

static string LowerCase(this string str)

Returns a lower-cased version of this string.


RawTime

static int RawTime(this DateTime dateTime)

Gets the raw time value, useful for calculating elapsed time periods. Had to be implemented as extension method. Assumed ticks is right.


Replace

static string Replace(this string str, string lookForText, string replaceWithText, bool caseSensitive)  
static string Replace(this string str, string oldValue, string newValue, StringComparison comparisonType)

Returns a copy of this string with all occurrences of LookForText replaced with ReplaceWithText.


ReplaceCharAt

static string ReplaceCharAt(this string str, int index, char newChar)  
static string ReplaceCharAt(this string str, int index, Byte newChar)

Returns a new string, with the specified character changed.


StartsWith

static bool StartsWith(this string str, string startsWithText, bool caseSensitive)

Checks whether this string starts with the specified text.


ToBool

static bool ToBool(this int i)

Convert integer to boolean.


ToInt

static int ToInt(this bool b)

Convert boolean to integer.


Truncate

static string Truncate(this string str, int length)

Truncate string to given length


UpperCase

static string UpperCase(this string str)

Returns a upper-cased version of this string.